package it.polito.let.jhp.types;

import java.io.Serializable;

public class TypeAttributes implements Serializable {

	private static final long serialVersionUID = 8210513211401472156L;

	Float FloatMax = null;

	Float FloatMin = null;

	String StringPattern = null;

	Integer IntegerMin = null;

	Integer IntegerMax = null;

	Integer StringLenMin = null;

	Integer StringLenMax = null;

	TypeAttributes() {
		//nop
	}

	TypeAttributes(TypeAttributes attributes) {
		FloatMax = attributes.FloatMax;
		FloatMin = attributes.FloatMin;
		StringPattern = attributes.StringPattern;
		IntegerMin = attributes.IntegerMin;
		IntegerMax = attributes.IntegerMax;
		StringLenMin = attributes.StringLenMin;
		StringLenMax = attributes.StringLenMax;
	}

	@Override
	public String toString() {
		StringBuffer res = new StringBuffer();

		if (FloatMax != null)
			res.append("\t Max Value= " + FloatMax+"\r\n");

		if (FloatMin != null)
			res.append("\t Min Value= " + FloatMin+"\r\n");

		if (StringPattern != null)
			res.append("\t Matching Pattern= " + StringPattern+"\r\n");

		if (IntegerMin != null)
			res.append("\t Min Value= " + IntegerMin+"\r\n");

		if (IntegerMax != null)
			res.append("\t Max Value= " + IntegerMax+"\r\n");

		if (StringLenMin != null)
			res.append("\t Min Length = " + StringLenMin+"\r\n");

		if (StringLenMax != null)
			res.append("\t Max Length= " + StringLenMax+"\r\n");

		return res.toString();
	}


}
